<?php

/**
 * Welcome to HDMS Kingfisher! There really isn't anything here, but since
 * the index file is the logical place to start looking when you want to hack
 * up some code, I figured I would put a little introduction here.
 *
 * This software runs atop another piece of code called Foundry3 (copyright
 * 2004-2006 the State News [http://www.statenews.com]). Foundry3 is a sort
 * of bastardized Front Controller/MVC/Active Record/Mapper Pattern framework.
 * Foundry3 handles all of the database stuff and object relation mapping for
 * you as well as routing all requests. So, this file is the front controller
 * for this app. Generally the url breaks down to something like this:
 *
 * http://www.somewhere.com/index.php/news/view/20060520
 * 			^					^		^	^		^
 *			|					|		|	\		|
 *		server url			this file module \		some sort of key
 *											node
 *
 * So, if you wanted to futz with the news:view method you would look in:
 *
 * [appPath]/controllers/news.class.php
 *
 * the model (usually just a skeleton file) would be in:
 *
 * [appPath]/models/news.class.php
 *
 * the view file would be in:
 *
 * [appPath]/views/news/view.tpl
 *
 * Pretty simple. Oh, one last thing, for the sake of security, the database
 * mapper uses a binding method to bind variables to markers in queries. It
 * isn't requred, but is better to use it that way. Example: if you wanted to
 * find users who were named 'mike' you would:
 *
 * <code>
 *	$userModel = $this->user();
 *  $data = $userModel->find(
 *		'username = :name',
 *		array( ':name' => 'mike' )
 *	);
 * </code>
 *
 * Have fun,
 * Mike Joseph <mike@mode3.net>, 20 May 2006.
 */
// generation time testing
$timeparts = explode( " ",microtime() );
$starttime = $timeparts[1].substr( $timeparts[0], 1 );

define( '__FOUNDRY_CONFIG_PATH', './foundry.config.php' );

if( is_file( __FOUNDRY_CONFIG_PATH ) ) {
	include_once( __FOUNDRY_CONFIG_PATH );
}

include_once( Foundry::config('confPath').'/kingfisher.config.php' );

$user = Foundry::load( 'USER_session' );


Foundry::load( 'FRAMEWORK_FoundryController', false, false );

$dbh = FoundryRegistry::get( 'dbh' );

include_once( Foundry::config( 'libPath' ).'/global.inc.php' );
include_once( Foundry::config( 'libPath' ).'/auth.inc.php' );
FoundryDispatcher::addObserver( 'onAdminNodeLoad', 'authObserver' );

FoundryController::start();

$timeparts = explode( " ",microtime() );
$endtime = $timeparts[1].substr( $timeparts[0], 1 );
$execute = $endtime-$starttime;

echo "<!-- created in $execute seconds using foundry ".
	Foundry::$version.' -->';


?>